package 设计原则;

import java.util.ArrayList;
import java.util.List;

/**
 * 员工
 */
class Employee {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}

/**
 * 经理
 */
class Manager {
    public List<Employee> getEmployees(String department) {
        List<Employee> employees = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            Employee employee = new Employee();
            // 雇员姓名
            employee.setName(department + i);
            employees.add(employee);
        }
        return employees;
    }

    public void printEmployee(String name) {
        List<Employee> employees = this.getEmployees(name);
        for (Employee employee : employees) {
            System.out.print(employee.getName() + ";");
        }
    }
}

/**
 * 总经理
 */
class President {
    private Manager manager = new Manager();

    public void checkEmployeeList(String name) {
        manager.printEmployee(name);
    }
}